package com.hundun.hddeal.dao;

import com.hundun.hddeal.entity.NextOrder;
import com.hundun.hddeal.entity.NextOrderPuls;
import com.hundun.hddeal.vo.StatusCountVo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;
import java.util.Date;
import java.util.List;

/**
 * 任务大厅小单接口
 * @author 谢
 */
@Component
public interface NextOrderMapper {
    int deleteByPrimaryKey(Long id);

    int insertSelective(NextOrder record);

    NextOrder selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(NextOrder record);

    /**批量录入链接*/
    int updateSomeUrl(NextOrder record);

    List<NextOrderPuls> selectGetofTask(@Param("adId")String adId, @Param("orderId") String orderId,@Param("type")String type,
                                        @Param("status") Byte status,@Param("gzhName")String gzhName, @Param("order") String order);

    List<NextOrder> selectMtofTask(@Param("mtId")String mtId, @Param("status")Byte status, @Param("gzhName")String gzhName,
                                   @Param("startTime") Date startTime, @Param("endTime")Date endTime,
                                   @Param("type") String type,@Param("hostId") String hostId,@Param("order")String order);

    NextOrderPuls selectGetByghId(@Param("mtId")String mtId,@Param("ghId") String ghId,@Param("orderId") String orderId,@Param("Id") Long id,@Param("type") String type);

    int updateStatus(@Param("orderId")String orderId,@Param("status")Byte status,@Param("realityMoney")Double realityMoney,@Param("ghId")String ghId);

    NextOrder selectByOreder(@Param("gzhName")String  gzhName,@Param("orderId") String orderId,@Param("count") Integer count);//count判断是否有多条订单

    int orderCount(@Param("orderId") String orderId,@Param("gzhName")String  gzhName);//判断订单条数条

    List<NextOrder> mtHostList(@Param("mtId") String mtId,@Param("adName") String adName,
                              @Param("startTime") Date startTime, @Param("endTime") Date endTime,@Param("type")String type);//查询媒体主id集合

    StatusCountVo selectAllStatus(@Param("mtId") String mtId, @Param("adId")String adId, @Param("orderId")String orderId,@Param("hostId")String hostId);

    /**
     * 查询批量ids订单
     * @param ids
     * @return
     */
    List<NextOrder> idsOrder(@Param("ids") Long[] ids);

    StatusCountVo selectReadStatus(@Param("mtId") String mtId,@Param("hostId")String hostId,@Param("type")String type);

    List<NextOrder> getAll(@Param("orderId")String orderId);

    /**
     * 更新已评价
     * @param orderId
     * @param isPublish
     * @return
     */
    int updatePublish(@Param("orderId")String orderId,@Param("isPublish")Integer isPublish);

}